<!DOCTYPE html>
<html>

<head>
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>搜索结果</title>
	<link rel="stylesheet" href="./css/reset.css">
	<link rel="stylesheet" href="./css/good_list.css">
</head>

<body>
	<header class="header">
		<img class="arrow" onclick="history.back()" src="./img/my_favorite/img-1_10.png" alt="">
		<span class="title">搜索结果</span>
	</header>
	<div class="search_body">
		<div class="search_frame_box">
			<input class="search_frame" placeholder="马卡龙色 多功能早餐机" type="text">
			<div class="search_icon"><img src="./img/search/search_03.png" alt=""></div>
		</div>
		<div class="serve">
			<div class="item">综合</div>
			<div class="item">销售</div>
			<div class="item">新品</div>
			<div class="item"><span>价格</span>
				<span class="icon_img">
					<div><img class="icon_top" src="./img/search/img_03.png" alt="">
					</div>
					<div><img class="icon_bottom" src="./img/search/img_07.png" alt="">
					</div>
				</span>
			</div>
		</div>
		<div class="search_content">
			<ul>
			</ul>
		</div>
		<div class="icon_fixed"><img src="./img/search/img_11.png" alt=""></div>
	</div>
	<script src="./js/axios.min.js"></script>
	<script src="./js/axios.config.js"></script>
	<script src="./js/utils.js"></script>
	<script>
		var osSarchContentUl = document.querySelector(".search_content ul")
		var id = params('id')
		var level = params('level')
		axios.get("/goods/list", { params: { pageSize: 5, pageIndex: 1, cate_id: id, cate_level: level } }).then(function (res) {
			console.log(res)
			if (res.status) {
				// 渲染数据
				res.data.forEach(function (item) {
					var list = `<li><a href="./commodity_particulars.html?id=${item.id}">
						<div class="img_box"><img class="search_img" src="${item.img_md}" alt=""></div>
						<div class="content_box">
							<div class="text">${item.name}</div>
							<div class="introduce">${item.hotPoint}</div>
							<div class="price">${item.price}</div>
						</div></a>
					</li>`
					// 插入DOM
					osSarchContentUl.insertAdjacentHTML('beforeend', list)
				})
			}
		})
	</script>
</body>

</html>